package com.hoshiicloud.goods.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hoshiicloud.common.query.OmnipotentParam;
import com.hoshiicloud.common.query.OmnipotentWrapper;
import com.hoshiicloud.common.update.UpdateBatchParam;
import com.hoshiicloud.goods.entity.goods.GoodsGallery;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * <p>
 * 商品图片资源表
 * </p>
 */
public interface GoodsGalleryService extends IService<GoodsGallery> {

    GoodsGallery saveGoodsGallery(GoodsGallery entity);

    boolean updateGoodsGalleryById(GoodsGallery entity);
    boolean  deleteGoodsGalleryById(Long id);

    /**
     *  根据自定义条件查询图片资源信息
     */
    List<GoodsGallery> listGoodsGalleryByWrapper(QueryWrapper wrapper, String key);

    /**
     * 批量保存
     */
    Boolean saveGoodsGalleryBatch(@RequestBody List<GoodsGallery> galleryList);

    List<GoodsGallery> listBySpuIds(List<Long> spuIds);

    /**
     * 批量删除
     */
    Boolean deleteBatchs(Long extSpuId);

    /**
     *  批量删除: 物理删除
     */
    Boolean removeBatch(@RequestBody List<OmnipotentWrapper> param);

    /**
     * 根据自定义条件进行批量更新
     */
    boolean updateBatchByWrapper(UpdateBatchParam<GoodsGallery> updateBatchParam);

    /**
     * 批量更新
     */
    Boolean updateBatch(OmnipotentParam<GoodsGallery> param);
}
